
var pageContext = new PageContextDatatable(settings||{});

pageContext.formInit = function(layero){
}
pageContext.renderUpdatePageOther = function(layero,data,option){
	layero.find("span[name='indexNumLabel']").text(data.indexNum);
	layero.find("span[name='idLabel']").text(data.id);
	layero.find("input[name='indexNum']").attr("oldval",0).val(0);
	tvc.changeDefaultValue(layero.find("input[name='indexNum']").get(0));
}
pageContext.additionalRenderPerRow = function(record, rowIndex, trObj){//搜索
	  var trKeyValue = record.id;
    trObj.attr("id",pageContext.setting.tableId+"_tr_"+trKeyValue);
    trObj.attr("val",trKeyValue);
    trObj.attr("label",record.id);
    trObj.attr("rowIndex",rowIndex);
}

pageContext.toAdd = function(option){
	var action = window.global.getFinalUrl(pageContext.setting.toAddUrl);
	load(action,"page-content",true,"新增"+pageContext.modelName,function(){
		
	});
}
pageContext.toDetail = function(id,data){
	var action = window.global.getFinalUrl(pageContext.setting.toDetailUrl);
	action = window.global.addPara(action,"id",id,true)
	load(action,"page-content",true,pageContext.modelName+"详情",function(){
		
	});
}
pageContext.toUpdate = function(id,data){
	var action = window.global.getFinalUrl(pageContext.setting.toUpdateUrl);
	action = window.global.addPara(action,"id",id,true)
	load(action,"page-content",true,"修改"+pageContext.modelName,function(){
		
	});
}
jQuery(function($) {
   pageContext.init();

	 $(document).find("input").each(function(){
		 $(this).attr("autocomplete","off");
	 });
}); 
